<style scoped lang="scss">
label {
}
</style>
<template>
  <section style="font-size: 16px;">

    <section style="margin-bottom: 5px;padding-bottom: 5px;border-bottom: 1px solid #ddd;">
      <section>
        <div style="padding-bottom: 8px;">
          <span style="padding-right: 10px;">物料</span>
          <span>金额:</span>
          <span>{{ toFixedInt($props.props_develMaterialCheck?.materialMoney) }}</span>
          <span style="padding-left:120px;">数量:</span>
          <span>{{ toFixedInt($props.props_develMaterialCheck?.receivingNum) }}</span>
        </div>
        <div v-if="($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType=='物料金额').length"
             style="display: flex;align-items: flex-start;justify-content: space-between;"
        >
          <span style="padding-right: 10px">附件</span>
          <uploadImagePlus
              :fileList="($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType=='物料金额')"
              :uploadType="$uploadType.file_purchase"
              :disabled="true"
              @change="files=>{
                              var attachListFilter_no=($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType!='物料金额');
                              $props.props_develMaterialCheck.attachList=(attachListFilter_no).concat(files.map(item=>{
                                  item.expendType='物料金额'
                                  return  item
                              }))
                           }"
          >
          </uploadImagePlus>
        </div>
      </section>
      <section v-if="$props?.props_develMaterialCheck?.courierMoney">
        <div style="margin-bottom: 5px;">
          <span style="padding-right: 10px;">专送</span>
          <span>金额:</span>
          <span>{{ toFixedInt($props?.props_develMaterialCheck?.courierMoney) }}</span>
        </div>
        <div style="display: flex;align-items: flex-start;justify-content: space-between;"
             v-if="($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType=='专送').length"
        >
          <span style="padding-right: 5px;">专送附件</span>
          <uploadImagePlus
              :fileList="($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType=='专送')"
              :uploadType="$uploadType.file_purchase"
              :disabled="true"
              @change="files=>{
                              var attachListFilter_no=($props?.props_develMaterialCheck?.attachList||[]).filter(item=>item.expendType!='专送');
                              $props.props_develMaterialCheck.attachList=(attachListFilter_no).concat(files.map(item=>{
                                  item.expendType='专送'
                                  return  item
                              }))
                           }"
          >
          </uploadImagePlus>
        </div>
      </section>
    </section>

    <section>
      <div v-for="(secItem,secIndex) in  ($props.props_secondaryList||[])"
           :key="secIndex"
           style="margin-bottom: 5px;padding-bottom: 5px;border-bottom: 1px solid #ddd;"
      >
        <div>
          <span style="padding-right: 10px;">{{ secItem?.processName }}</span>
          <span>金额:</span>
          <span>{{ toFixedInt(secItem?.processMoney) }}</span>
          <span style="padding-left:120px;">数量:</span>
          <span>{{ toFixedInt(secItem?.processNum) }}</span>
        </div>
        <div style="display: flex;align-items: flex-start;justify-content: space-between"
             v-if="(secItem?.attachList||[]).filter(item=>item.expendType=='二次工艺').length">
          <span style="padding-right: 5px">附件</span>
          <uploadImagePlus
              :fileList="(secItem?.attachList||[]).filter(item=>item.expendType=='二次工艺')"
              :uploadType="$uploadType.file_purchase"
              :disabled="true"
              @change="files=>{
                              var attachListFilter_no=(secItem?.attachList||[]).filter(item=>item.expendType!='二次工艺');
                              secItem.attachList=(attachListFilter_no).concat(files.map(item=>{
                                  item.expendType='二次工艺'
                                  return  item
                              }))
                           }"
          >
          </uploadImagePlus>
        </div>
        <div v-if="secItem?.courierMoney">
          <div>
            <span style="padding-right: 10px;">是否专送</span>
            <span>金额:</span>
            <span>{{ toFixedInt(secItem?.courierMoney) }}</span>
          </div>
          <div style="display: flex;align-items: flex-start;justify-content: space-between">
            <span style="padding-right: 10px;">专送附件</span>
            <uploadImagePlus
                :fileList="(secItem?.attachList||[]).filter(item=>item.expendType=='二次工艺专送')"
                :uploadType="$uploadType.file_purchase"
                :disabled="true"
                @change="files=>{
                              var attachListFilter_no=(secItem?.attachList||[]).filter(item=>item.expendType!='二次工艺专送');
                              secItem.attachList=(attachListFilter_no).concat(files.map(item=>{
                                  item.expendType='二次工艺专送'
                                  return  item
                              }))
                           }"
            >
            </uploadImagePlus>
          </div>
        </div>

      </div>

    </section>
  </section>

</template>
<script>
import { toFixedInt } from '@/utils';
import uploadImagePlus from '@/components/UploadImage/uploadImagePlus.vue';
import receiving_secCom from '@/views/components/develmaterial/receiving_sec.vue';

export default {
  components: { receiving_secCom, uploadImagePlus },
  data() {
    return {
      toFixedInt,
    };
  },

  props: {
    props_develMaterialCheck: { type: [Object] },
    props_secondaryList: {
      type: [Object, Array],
    },
  },

};
</script>
